package cn.jx.asc.lhg.bzxq.dao;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * @author lhg
 */
public class DataBaseOpenHelper extends SQLiteOpenHelper {
    private static final int VERSION = 1;
    private static final String DBNAME = "bird.db";
    public DataBaseOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    public DataBaseOpenHelper(Context context){
        super(context,DBNAME,null,VERSION);
    }
    public DataBaseOpenHelper(Context context,String dbname){
        super(context,dbname,null,VERSION);
    }


    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE IF NOT EXISTS tb_test (id varchar(40) primary key NOT NULL,name varchar(20),integral ineteger,date varchar(20))");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
